package com.mtask.common.entity.task;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.mtask.common.entity.base.BaseEntity;
import lombok.*;

import javax.persistence.*;

@Entity
@Table(name = "task_job")
@Builder
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class TaskJob extends BaseEntity {

    @ManyToOne(fetch = FetchType.EAGER)
    @JsonBackReference
    @JoinColumn(
            name = "task_group_id",
            referencedColumnName = "id",
            nullable = false,
            columnDefinition = "integer")
    private TaskGroup taskGroup;

    private String name;
    private String remark;
    private String cron;
    private Boolean isFailMail;
    private String status;
    private String statusMsg;
    private Integer serviceId;
    private String failMailRule;
    private String referenceType;
    private Integer referenceId;
}
